|
|
|
|
|
|
|
Learn to use the basic ADO object model |
|
|
|
|
|
|
|
|
Learn to use the Connection object |
|
|
|
|
|
|
|
|
Learn to use the Recordset object |
|
|
|
|
|
|
|
|
Learn Command object usage |
|
|
|
|
|
|
|
|
Sample Project File: \Chapter24\ADO.vbp |
|
|
|
|
|
|
|
|
The Connection object is the highest object in ADO. If you plan on opening multiple Recordset objects in your application, its best that you open a connection first and then pass that connection to each recordset. This one connection can then be used over and over again instead of having to make a new connection each time. Although it isnt necessary to create a Connection object, doing so helps speed up access and cut down on the amount of resources used on both the client and the server. |
|
|
|
|
|
|
|
|
Properties of the Connection Object |
|
|
|
|
|
|
|
|
A lot of properties are associated with the Connection object. Not all of them are useful for understanding the basics of ADO, so Table 24.1 only covers those that are applicable right now. |
|
|
|
|
| Table 24.1 ADO Connection Object Properties. | | Property | Description | | CommandTimeout | How long ADO will wait for a command to execute a stored procedure or other SQL action statement like INSERT, UPDATE, DELETE. The default is 30 seconds, but this can be set to any number of seconds or to 0 to wait indefinitely. | | ConnectionString | A string of connection information thats used to connect to a data source. This varies with each provider you use. An ODBC providers connection string is very different than an OLE DB connection string. Youll see examples of how to set this in this chapter. |
|
|
|
|
|
|
(table continued on next page) |
|
|
|
|
|